import Loading from './loading.vue'

import vue from 'vue'

const LoadingCls = vue.extend(Loading)
const instance = new LoadingCls()

export default {
  name: 'Loading',
  show() {
    instance.$mount(document.createElement('div'))
    document.body.appendChild(instance.$el)
  },
  hide() {
    setTimeout(() => {
      document.body.removeChild(instance.$el)
    }, 300)
    instance.$destroy()
  }
}
